/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package entitas;

import java.io.Serializable;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author rhiezall
 */
@Entity
@Table(name = "booking")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "BookingBuku.findAll", query = "SELECT b FROM BookingBuku b"),
    @NamedQuery(name = "BookingBuku.findById", query = "SELECT b FROM BookingBuku b WHERE b.id = :id")})
public class BookingBuku implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(name = "id")
    private Integer id;
    
    @Basic(optional = false)
    @Lob
    @Column(name = "judul_buku")
    private String judulBuku;

    @Basic(optional = false)
    @Lob
    @Column(name = "pengarang")
    private String pengarang;

    @Basic(optional = false)
    @Lob
    @Column(name = "tanggal_peminjaman")
    private String tanggalPeminjaman;

    public BookingBuku() {
    }

    public BookingBuku(Integer id) {
        this.id = id;
    }

    public BookingBuku(Integer id, String judulBuku, String pengarang, String tanggalPeminjaman) {
        this.id = id;
        this.judulBuku = judulBuku;
        this.pengarang = pengarang;
        this.tanggalPeminjaman =  tanggalPeminjaman;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getJudulBuku() {
        return judulBuku;
    }

    public void setJudulBuku(String judulBuku) {
        this.judulBuku = judulBuku;
    }

    public String getPengarang() {
        return pengarang;
    }

    public void setPengarang(String pengarang) {
        this.pengarang = pengarang;
    }

    public String getTanggal_Peminjaman() {
        return tanggalPeminjaman;
    }

    public void setTanggal_Peminjaman(String tanggalPeminjaman) {
        this.tanggalPeminjaman = tanggalPeminjaman;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof BookingBuku)) {
            return false;
        }
        BookingBuku other = (BookingBuku) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "entitas.BookingBuku[ id=" + id + " ]";
    }

}
